#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        if(nums.size() == 0) return NULL;
        int slowIndex = 0;
        for(int fastIndex = 1;fastIndex < nums.size();++fastIndex){
            if(nums[slowIndex] != nums[fastIndex]){
                ++slowIndex;
                nums[slowIndex] = nums[fastIndex];

            }    
            else{
                nums[slowIndex] = nums[fastIndex];
            }
        }
        return slowIndex + 1;
    }
};
int main()
{
    Solution sol;
    vector<int> vec = {0,0,1,1,1};
    cout << sol.removeDuplicates(vec) << endl;
    return 0;
}